// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://localhost/upf/ws/sales.1cws?wsdl
//  >Import : http://localhost/upf/ws/sales.1cws?wsdl>0
// Encoding : UTF-8
// Version  : 1.0
// (10.09.2013 23:16:27 - - $Rev: 56641 $)
// ************************************************************************ //

unit YB_sales;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

const
  IS_NLBL = $0004;
  IS_REF  = $0080;


type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Embarcadero types; however, they could also
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"[Gbl]



  // ************************************************************************ //
  // Namespace : http://www.yarbroiler.ru/Sales
  // soapAction: http://www.yarbroiler.ru/Sales#YB_sales:%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // use       : literal
  // binding   : YB_salesSoapBinding
  // service   : YB_sales
  // port      : YB_salesSoap
  // URL       : http://localhost/upf/ws/sales.1cws
  // ************************************************************************ //
  YB_salesPortType = interface(IInvokable)
  ['{37A2B62D-3427-204D-B730-870F4607AB07}']
    function  GetSales(const Hostname: string): string; stdcall;
    function  GetOrder(const OrderGUID: string; const Hostname: string; const Username: string): string; stdcall;
  end;

function GetYB_salesPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): YB_salesPortType;


implementation
  uses SysUtils;

function GetYB_salesPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): YB_salesPortType;
const
  defWSDL = 'http://localhost/upf/ws/sales.1cws?wsdl';
  defURL  = 'http://localhost/upf/ws/sales.1cws';
  defSvc  = 'YB_sales';
  defPrt  = 'YB_salesSoap';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as YB_salesPortType);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


initialization
  { YB_salesPortType }
  InvRegistry.RegisterInterface(TypeInfo(YB_salesPortType), 'http://www.yarbroiler.ru/Sales', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(YB_salesPortType), 'http://www.yarbroiler.ru/Sales#YB_sales:%operationName%');
  InvRegistry.RegisterInvokeOptions(TypeInfo(YB_salesPortType), ioDocument);
  { YB_salesPortType.GetSales }
  InvRegistry.RegisterMethodInfo(TypeInfo(YB_salesPortType), 'GetSales', '',
                                 '[ReturnName="return"]');
  InvRegistry.RegisterParamInfo(TypeInfo(YB_salesPortType), 'GetSales', 'Hostname', '',
                                '', IS_NLBL);
  { YB_salesPortType.GetOrder }
  InvRegistry.RegisterMethodInfo(TypeInfo(YB_salesPortType), 'GetOrder', '',
                                 '[ReturnName="return"]');
  InvRegistry.RegisterParamInfo(TypeInfo(YB_salesPortType), 'GetOrder', 'Hostname', '',
                                '', IS_NLBL);
  InvRegistry.RegisterParamInfo(TypeInfo(YB_salesPortType), 'GetOrder', 'Username', '',
                                '', IS_NLBL);

end.
